Skip to content

[CP Staging] Revert optimistic scan-failed expense move on pay - #98914

Merged
Beamanator merged 1 commit into
mainfrom
revert/97084
Aug 18, 2026
Merged

Beamanator merged 1 commit into
mainfrom
revert/97084

Conversation

@deetergp

@deetergp deetergp commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Reverts PR 97084, which caused the deploy blocker.

PR 97084 optimistically creates a client-side report for a scan-failed expense on Pay. The backend then creates its own report with a different ID, so the optimistic report is deleted in successData on reconnect. A user who is viewing that optimistic report lands on the "Hmm... it's not here" page.

This revert restores the behaviour that production runs today. The scan-failed expense stays in the report until reconnect, and the backend moves it.

Note on the revert: src/libs/TransactionUtils/index.ts needed a manual conflict resolution. Commit 05eb2df ("Revert #96772") removed isFailedScanAmountPlaceholder after PR 97084 merged, so the pre-97084 export of that symbol must not come back. The resolution keeps neither side of the conflict. The other five files are byte-identical to their pre-97084 state.

This revert reopens issue 96257, which is Weekly priority.

Fixed Issues

$ #98821
PROPOSAL:

Tests

  1. Open a workspace chat where you can submit, approve, and pay.
  2. Create a manual expense with an amount and a merchant.
  3. Create a scan expense with a receipt that fails SmartScan.
  4. Wait for the scan to fail.
  5. Open the report, then click Submit and Approve.
  6. Go offline.
  7. Click Mark as paid.
  8. Verify that the scan-failed expense stays in the report, and that no new report appears.
  9. Go online.
  10. Verify that the backend moves the scan-failed expense to a new report.
  11. Verify that the "Hmm... it's not here" page does not appear.
  • Verify that no errors appear in the JS console

Offline tests

  1. Do steps 1 to 5 above.
  2. Go offline.
  3. Click Mark as paid.
  4. Verify that the scan-failed expense stays in the report while you are offline.
  5. Verify that no new report appears while you are offline.

QA Steps

  1. Go to a workspace chat and create a manual expense.
  2. Create a scan expense with an invalid receipt, then wait for the scan to fail.
  3. Open the report, then click Submit and Approve.
  4. Go offline.
  5. Click Mark as paid.
  6. Verify that the scan-failed expense stays in the report.
  7. Go online.
  8. Verify that the "Hmm... it's not here" page does not appear.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Reverts PR 97084 to clear deploy blocker 98821.

Co-authored-by: Claude <claude@anthropic.com>
@deetergp
deetergp marked this pull request as ready for review August 18, 2026 21:23
@deetergp
deetergp requested review from a team as code owners August 18, 2026 21:24
@melvin-bot
melvin-bot Bot requested a review from brunovjk August 18, 2026 21:24
@melvin-bot

melvin-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

@brunovjk Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and removed request for a team August 18, 2026 21:24

@Beamanator Beamanator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Beamanator
Beamanator merged commit d35e85c into main Aug 18, 2026
62 of 63 checks passed
@Beamanator
Beamanator deleted the revert/97084 branch August 18, 2026 21:31
@Beamanator Beamanator changed the title Revert optimistic scan-failed expense move on pay [CP Staging] Revert optimistic scan-failed expense move on pay Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚧 Beamanator has triggered a test Expensify/App build. You can view the workflow run here.

OSBotify pushed a commit that referenced this pull request Aug 18, 2026
Revert optimistic scan-failed expense move on pay

(cherry picked from commit d35e85c)

(cherry-picked to staging by Beamanator)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Aug 18, 2026
@OSBotify OSBotify mentioned this pull request Aug 18, 2026
86 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.4.55-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🔁 Filed a Staging retest request for deploy blockers #98821 after this PR was cherry-picked to staging.

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required — no draft PR created.

This PR reverts PR #97084, restoring the behavior production already runs. The diff is limited to internal client-side logic and its tests:

  • src/libs/TransactionUtils/index.ts
  • src/libs/actions/IOU/Hold.ts
  • src/libs/actions/IOU/PayMoneyRequest.ts
  • tests/actions/IOUTest/HoldTest.ts, tests/actions/IOUTest/PayMoneyRequestTest.ts, tests/unit/TransactionUtilsTest.ts

The change concerns how a scan-failed expense is handled on Pay (optimistic report creation vs. leaving the expense in place until the backend moves it on reconnect). This is implementation behavior that is invisible to end users and is not documented anywhere in App/docs/articles — there is no user-facing feature, workflow, setting, label, or copy change. The only matches in the help site for terms like "scan failed" are in the SmartScan troubleshooting articles' keyword frontmatter, which cover unrelated end-user receipt-scanning guidance.

Since the revert introduces no new or changed public behavior, the help site remains accurate as-is.

@deetergp, no help site PR was needed here, so there's nothing to review — flagging for your awareness. If you believe a docs update is warranted, let me know what behavior should be documented and I'll draft one.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.55-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.4.56-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.56-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants